# 1.1、取出第六个的值
# list1 = [465,8231,8123485,215,612318,12534,561231561,5631,584,2318564,584,5634,561326,4156,1]
# print(list1[5])

# 1.2、判断，如果列表中的值是561231561，则输出：今天你猜对了哦~~~~
# list1 = [465,8231,8123485,215,612318,12534,561231561,5631,584,2318564,584,5634,561326,4156,1]
# if [561231561 in list1]:
#     print("你今天猜对了哦~~~~")

# 1.3、取出这个列表里面所有的偶数，创建空列表，使用append方法，添加到新的列表里
# list1 = [465,8231,8123485,215,612318,12534,561231561,5631,584,2318564,584,5634,561326,4156,1]
# new_list = []
# for i in range(len(list1)):
#     if list1[i] %2==0:
#         new_list.append(list1[i])
# print(new_list)

# 2、定义集合，使用for遍历访问元素
# set_ = {11,22,33,44,55}
# for i in set_:
#     print(i)

# 3、定义字符串，使用for遍历访问元素
# str_ ={"aa","bb","cc","dd","ee"}
# for i in str_:
#     print(i)

# 5、定义列表，使用for遍历访问元素
# list1 = [465,8231,8123485,215,612318,12534,561231561,5631,584,2318564,584,5634,561326,4156,1]
# for i in list1:
#     print(i)
# 6、遍历：{465,84564,5641,21564,1891563,481564,651,"刘闯","王李","李四","王三"}
# set_1 = {465,84564,5641,21564,1891563,481564,651,"刘闯","王李","李四","王三"}
# for i in set_1:
#     print(i)

# 6.1、使用for循环遍历上面的集合，如果输出到了刘闯，则循环结束
# for i in {465,84564,5641,21564,1891563,481564,651,"刘闯","王李","李四","王三"}:
#     if i !="刘闯":
#         print(i,end=" ")
#     else:
#         break
# print()

# 9、使用randint随机数方法，随机范围1~9999,将每次随机到的值添加到列表里面，列表长度最多只能是5位
# import random
# new_list = []
# for i in range(0,5):
#     num = random.randint(1, 9999)
#     new_list.append(num)
# print(new_list)